/* gcc `edje-config --cflags --libs` `ecore-config --cflags --libs` example.c -o e*/
/* A sample EDC can be had here: http://www.cuddletech.com/edje/edc/crossfade.edc */
#include <Ecore_Evas.h>
#include <Ecore.h>
#include <Edje.h>
int app_signal_exit(void *data, int type, void *event);
/* GLOBALS */
Ecore_Evas *     ee;
Evas         *   evas;
Evas_Object *    edje;
double    edje_w, edje_h;
int main(int argv, char *argc[]){
	ecore_init();
	ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, app_signal_exit, NULL);
	ecore_evas_init();
	ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 0, 0);
	ecore_evas_title_set(ee, "TITLE");
	ecore_evas_borderless_set(ee, 0);
	ecore_evas_shaped_set(ee, 0);
	ecore_evas_show(ee);
	evas = ecore_evas_get(ee);
	evas_font_path_append(evas, "/usr/local/share/edje/data/test/fonts/");
	edje_init();
	edje = edje_object_add(evas);
	edje_object_file_set(edje, "crossfade.eet", "test");
	evas_object_move(edje, 0, 0);
	edje_object_size_min_get(edje, &edje_w, &edje_h);
	evas_object_resize(edje, edje_w, edje_h);
	evas_object_show(edje);
	ecore_evas_resize(ee, (int)edje_w, (int)edje_h);
	ecore_evas_show(ee);
	ecore_main_loop_begin();
        return 0;
}
int app_signal_exit(void *data, int type, void *event){
	        printf("DEBUG: Exit called, shutting down\n");
		        ecore_main_loop_quit();
			        return 1;
}

